import WechatApi from '../lib/api/index'
import WechatEvent from '../lib/event/index'

const WechatApiSymbol = Symbol('Application#wechatApi')
const WechatEventSymbol = Symbol('Application#wechatEvent')

export default {
  get wechatApi () {
    if (!this[WechatApiSymbol]) {
      this[WechatApiSymbol] = new WechatApi(this)

      this[WechatApiSymbol].WechatApi = WechatApi
    }

    return this[WechatApiSymbol]
  },
  get wechatEvent () {
    if (!this[WechatEventSymbol]) {
      this[WechatEventSymbol] = new WechatEvent(this)

      this[WechatEventSymbol].WechatEvent = WechatEvent
    }

    return this[WechatEventSymbol]
  }
}
